import {
	request
} from "../utils/request"
// 首页列表
export const apiHomeArtList = (data) => {
	return request({
		url: '/',
		data
	})
}

// 登录
export const apiDoLog = (data) => {
	return request({
		url: '/login',
		method: "POST",
		data
	})
}

// 注册
export const apiDoReg = (data) => {
	return request({
		url: '/register',
		method: "POST",
		data
	})
}


// 获取软件配置
export const apiGetConfig = (data) => {
	return request({
		url: '/config',
		data
	})
}


// 获取分类
export const apiGetCategory = (data) => {
	return request({
		url: '/category/',
		data
	})
}

// 文章详细
export const apiReadArt = (data) => {
	return request({
		url: '/article/read',
		data
	})
}

// 文章评论
export const apiGetComment = (data) => {
	return request({
		url: '/comment/list',
		data
	})
}

// 添加评论
export const apiSendComment = (data) => {
	return request({
		url: '/comment/add',
		data,
		method: "POST"
	})
}


// 我的评论
export const apiGetMyComments = (data) => {
	return request({
		url: '/comment',
		data
	})
}

// 购买文章
export const apiPayArt = (data) => {
	return request({
		url: '/article/pay',
		data,
	})
}


// 个人信息
export const apiGetAccount = (data) => {
	return request({
		url: '/account',
		data,
	})
}
// 好友列表
export const apiGetFriendList = (data) => {
	return request({
		url: '/friend/getFriends',
		data
	})
}

// 消息数量
export const apiMsgCount = () => {
	return request({
		url: '/msg'
	})
}


// 关注/取消关注
export const apiToggleFollow = (data) => {
	return request({
		url: '/follow/doFollow',
		data
	})
}


// 系统通知
export const apiNoticeList = (data) => {
	return request({
		url: '/msg/notification',
		data
	})
}

// 一键读取系统消息
export const apiReadAllNotice = (data) => {
	return request({
		url: '/msg/readAll',
		data
	})
}

// 我的文章
export const apiGetArticleList = (data) => {
	return request({
		url: '/article',
		data
	})
}

// 我的文章收藏
export const apiGetMyArtCollect = (data) => {
	return request({
		url: '/article/myCollect',
		data
	})
}

export const apiToggleCollectArt = (data) => {
	return request({
		url: '/article/collect',
		data
	})
}

// 查看别人主页
export const apiSeeInfo = (data) => {
	return request({
		url: '/account/info',
		data
	})
}

// 我的关注
export const apiGetFollow = (data) => {
	return request({
		url: '/follow',
		data
	})
}


// 粉丝
export const apiGetFans = (data) => {
	return request({
		url: '/follow/list',
		data
	})
}


// 上传图片
export const apiArtUploadImg = (data) => {
	return request({
		url: '/article/uploadImg',
		data,
		isUpload: true
	})
}



// 发布文章
export const apiAddArticle = (data) => {
	return request({
		url: '/article/add',
		data,
		method: "POST"
	})
}

// 退出登录
export const apiLogOut = (data) => {
	return request({
		url: '/login/logout'
	})
}

// 编辑文章
export const apiEditArt = (data) => {
	return request({
		url: '/article/edit',
		data,
		method: "POST"
	})
}
// 删除文章
export const apiDelArt = (data) => {
	return request({
		url: '/article/del',
		data
	})
}

// 修改密码
export const apiChangePwd = (data) => {
	return request({
		url: '/account/changePassword',
		data,
		method: "POST"
	})
}


// 签到
export const apiDoSign = (data) => {
	return request({
		url: '/sign/do',
	})
}

// 使用卡密
export const apiUseFake = (data) => {
	return request({
		url: '/fake/use',
		data,
		method: "POST"
	})
}

// 卡密兑换记录
export const apiFakeList = (data) => {
	return request({
		url: '/fake/list',
		data
	})
}

// 积分明细
export const apiScoreLog = (data) => {
	return request({
		url: '/account/getScoreLog'
	})
}

// 获取积分项目
export const apiGetScoreItem = (data) => {
	return request({
		url: '/pay/list'
	})
}

// 发起支付
export const apiInitPay = (data) => {
	return request({
		url: '/pay/initOrder',
		data,
		method: "POST"
	})
}

// 统计打开软件次数
export const apiStartUp = (data) => {
	return request({
		url: '/index/startUp',
	})
}


// 获取轮播图
export const apiGetCarousel = (data) => {
	return request({
		url: '/index/carousel',
	})
}


// 商品列表
export const apiGetGoods = (data) => {
	return request({
		url: '/good/list',
		data
	})
}

// 商品详细
export const apiGetGoodsDetail = (data) => {
	return request({
		url: '/good/detail',
		data
	})
}

// 商品兑换
export const apiGoodPay = (data) => {
	return request({
		url: '/good/pay',
		data
	})
}

// 删除评论
export const apiDelComment = (data) => {
	return request({
		url: '/comment/del',
		data
	})
}


// 上传头像
export const apiUploadAvator = (data) => {
	return request({
		url: '/account/uploadAvator',
		data,
		isUpload: true
	})
}

// 用户信息编辑
export const apiChangeAccount = (data) => {
	return request({
		url: '/account/edit',
		data,
		method: "POST"
	})
}